<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<script type="text/javascript">
	function dataBackup() {
		
		isperp.showLoading();
		
		$.get("db/dataManage/backupData", function(data) {
			isperp.hideLoading();
			if (data.success) {
				isperp.tooltip("备份成功！");
				dataBackupLogGrid.reload();
			} else {
				isperp.alertError(data.data);
			}

		});
	}

	function clearBusinessData() {
		$.get("db/dataManage/clearBusinessData", function(data) {
			if (data.success) {
				isperp.tooltip("业务数据清空成功！");
				dataBackupLogGrid.reload();
			} else {
				isperp.alertError(data.data);
			}
		});
	}
</script>

<isperp:grid url="db/dataBackupLog/list" gridId="dataBackupLogGrid"
	cusFormatterActions="true" cusDeleteUrl="db/dataBackupLog/delete">
	<jsp:attribute name="toolbar">
	<isperp:toolbar id="dataBackupLogToolbar">	<button
				id="dataBackupCreate" type="button" class="nui-mainbtn"
				onclick="dataBackup();">备份数据</button>
		<button id="clearBusinessData" type="button"
				onclick="clearBusinessData();">清空业务数据</button>
	</isperp:toolbar>

	</jsp:attribute>
	<jsp:attribute name="searchbar">
	<table class="search-table">
		<tbody>
			<tr>
				<td align="right">备份时间：</td>
				<td><input type="date" field="createDate" op="gt">~<input
						type="date" field="createDate" op="lt">
					</td>
			</tr>
		</tbody>
	</table>
	</jsp:attribute>
	<jsp:body>
	<isperp:column name="id" title="id" hidden="true"></isperp:column>
 
	<isperp:column name="createDate" title="备份时间" width="200">
	</isperp:column>
	<isperp:column name="fileSize" title="大小" width="200">
	</isperp:column>
	<isperp:column name="filePath" title="存放位置" formatter="return pathFormatter(cellvalue)" isFormatterFun="true" width="200">
	</isperp:column>
	 
</jsp:body>

</isperp:grid>
<script type="text/javascript">
	function pathFormatter(cellvalue) {
		return "<a target='blank' href='"+ cellvalue +"'>" + cellvalue + "</a>";
	}
</script>
